import { ref, reactive, toRefs, computed, getCurrentInstance } from "vue";

export const mixin = function() {
  const int = getCurrentInstance();
  const data_mixin = reactive({
    count: 0,
  });
  const double = computed(() => data_mixin.count * 2);
  function increment() {
    data_mixin.count++;
  }
  //   mixin反模式下无需使用toRefs去解构data_mixin
  return {
    data_mixin,
    double,
    increment,
  };
};
